<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><{$tpl_title}><{T w='Content Management System'}></title>
<link href="<{$smarty.const.BASEPATH}>/css/base.css" rel="stylesheet"/>
<link href="<{$smarty.const.BASEPATH}>/css/admin_style.css" rel="stylesheet"/>
<script type="text/javascript" src="<{$smarty.const.WEBDIR}>js/jquery.min.js"></script>
<script type="text/javascript" src="<{$smarty.const.WEBDIR}>js/validform/js/Validform.min.js"></script>
<script type="text/javascript">
$(function(){ // 当页面加载完毕的时候

	$(".regform:last").Validform({
		tiptype:2,
		ajaxPost:true,
		callback:function(data){
			if(data.status=="y"){
				setTimeout(function(){
					$.Hidemsg(); //公用方法关闭信息提示框;
                    parent.location.reload();
                    //location.href="<{spUrl c=user a=index}>";
				},2000);
                
			}
		}
	});    
});
</script>
</head>
<body>

   <form class="regform" action="<{spUrl c=user a=save}>" method="post"> 
   <table class="tab_list">
   <caption><a href="#">◆<{if $action eq 'add'}><{T w='Add user'}><{/if}><{if $action eq 'edit'}><{T w='Edit user'}><{/if}></a></caption>
        <tr>
            <td class="need" style="width:10px;">*</td>
            <td style="width:50px;">用户名：</td>
            <td style="width:150px;"><input type="text" value="<{$user.uname}>" name="uname" class="inputxt" datatype="s" nullmsg="请输入用户名！" errormsg="只能是英文字母！" /></td>
            <td><div class="Validform_checktip">昵称至少6个字符,最多18个字符</div></td>
        </tr>
        <tr>
            <td class="need">*</td>
            <td>您的姓：</td>
            <td><input type="text" value="<{$user.firstname}>" name="firstname" class="inputxt" datatype="*" nullmsg="请输入姓！" /></td>
            <td><div class="Validform_checktip">姓1-2字符</div></td>
        </tr>
        <tr>
            <td class="need">*</td>
            <td>您的名：</td>
            <td><input type="text" value="<{$user.lastname}>" name="lastname" class="inputxt" datatype="*" nullmsg="请输入你的字！" /></td>
            <td><div class="Validform_checktip">名1-3字符</div></td>
        </tr>
        <tr>
            <td class="need">*</td>
            <td>密码：</td>
            <td><input type="password" value="" name="upass" class="inputxt" <{if $action eq "add"}>datatype="*6-16" nullmsg="请设置密码！" errormsg="密码范围在6~16位之间,不能使用空格！"<{/if}> /></td>
            <td><div class="Validform_checktip">密码范围在6~16位之间,不能使用空格</div></td>
        </tr>
        <tr>
            <td class="need">*</td>
            <td>确认密码：</td>
            <td><input type="password" value="" name="confirmpassword" class="inputxt" <{if $action eq "add"}>datatype="*" recheck="upass" nullmsg="请再输入一次密码！" errormsg="您两次输入的账号密码不一致！" <{/if}>/></td>
            <td><div class="Validform_checktip">两次输入密码需一致</div></td>
        </tr>
        <tr>
            <td class="need"></td>
            <td>Email：</td>
            <td><input type="text" value="<{$user.email}>" name="email" class="inputxt" datatype="e" ignore="ignore" nullmsg="请输入您常用的邮箱！" errormsg="请输入您常用的邮箱！" /></td>
            <td><div class="Validform_checktip">请输入您常用的邮箱</div></td>
        </tr>
        <tr>
            <td class="need">*</td>
            <td>性别：</td>
            <td><input type="radio" value="1" name="gender" id="male" class="pr1"/><label for="male">男</label> <input type="radio" value="2" name="gender" id="female" class="pr1" /><label for="female">女</label></td>
            <td><div class="Validform_checktip"></div></td>
        </tr>
        <tr>
            <td class="need">*</td>
            <td>用户组：</td>
            <td><select name="usergroup" id="usergroup"><{foreach item=item from=$tUserGroup}>
                          <option <{if $user.gid eq $item.gid}>selected="selected"<{/if}> label="<{$item.gname_cn}>" value="<{$item.gid}>"><{$item.gname_cn}></option>
                          <{foreachelse}><{/foreach}></select></td>
            <td><div class="Validform_checktip"></div></td>
        </tr>
        <tr>
            <td class="need">*</td>
            <td>开放：</td>
            <td><select name="enabled" id="enabled">  <{foreach item=item from=$tUserEnabled}>
                          <option <{if $user.enabled eq $item.value}>selected="selected"<{/if}> label="<{$item.name}>" value="<{$item.value}>"><{$item.name}></option>
                          <{foreachelse}><{/foreach}></td>
            <td><div class="Validform_checktip"></div></td>
        </tr>

        <tr>
            <td class="need"></td>
            <td></td>
            <td colspan="2" style="padding:10px 0 18px 0;">
                <input type="hidden" name='action' id='action' value="<{$action}>"/>
                      <input type="hidden" name='uid' id='uid' value="<{$user.uid}>"/><input class="newuser" type="submit" value="提 交" /> <input type="reset" value="重 置" />
            </td>
        </tr>
    </table>
</form>
</body>
</html>